package br.com.abril.task;

import org.apache.log4j.Logger;

import br.com.abril.job.AbstractTask;

import com.force.abril.booking.download.ExecutiveBookingServiceActivator;
import com.sforce.ws.ConnectionException;

public class ExecutiveBookingTask extends AbstractTask {

	private static final Logger logger = Logger
			.getLogger(ExecutiveBookingTask.class);

	private ExecutiveBookingServiceActivator service;

	public ExecutiveBookingTask() {
		service = applicationContext.getBean(ExecutiveBookingServiceActivator.class);

	}

	@Override
	public void execute() {
		try {
			service.downloadBookings();
			logger.info("................ Download Executive Booking completed");

			
		} catch (ConnectionException e) {
			logger.error("Unable to Connect to SalesForce", e);
		}
	}

}
